import os
import sys
from django.conf import settings

DEBUG = os.environ.get('DEBUG','on') == 'on'
settings.configure(
	DUBUG = DEBUG,
	SECRET_KEY = 'thisisthesecrekey',
	ROOT_URLCONF = __name__,
	ALLOWED_HOSTS = ['*'],
	MIDDLEWARE_CLASSES = ['django.middleware.common.CommonMiddleware',
		'django.middleware.csrf.CsrfViewMiddleware',
		'django.middleware.clickjacking.XFrameOptionsMiddleware',])

from django.conf.urls import url
from django.http import HttpResponse

def index(request):
	return HttpResponse('hello word')

def demo(request):
	return HttpResponse('demo2')

class DemoViews():
	def getDemo(request):
		return HttpResponse(os.environ.get('DEBUG','off') == 'off')


urlpatterns = [
	url('demo/',demo),
	url('index/',index),
	url('',DemoViews.getDemo),]


if __name__ == "__main__":
    from django.core.management import execute_from_command_line
    execute_from_command_line(sys.argv)


